package com.crawler;

import java.util.ArrayList;
import java.util.List;

public class Pipeline extends CrawlerModule {

	private List<Processor> processors = new ArrayList<>();

	public Pipeline(Crawler c) {

		super(c);
	}

	public void process(CrawlingDocument cdoc) {

		for (Processor p : processors) {
			p.process(cdoc);
		}
	}

	public void addProcessor(Processor p) {

		assert p != null;
		processors.add(p);
	}

	public void removeProcessor(Processor p) {
		processors.remove(p);
	}

}
